<% if @success %>
    var form = $('#comment_form');
    $(form).empty();
    $("<%= j render @comment %>").insertBefore(form);
    $('span#comments-count').html("({0})".format(<%= @count %>))
    $(form).append('<%= ajax_loader %>');
    $(form).append('<%= link_to_new_comment @document %>');
    ShowNotify("<%= t('comments.create.success') %>", "");
<% else %>
    $('#comment_form').html("<%= j(render :partial =>  'form', :locals => {:comment => @comment, :document => @document}) %>");
    ShowNotify("<%= t('comments.create.error') %>", "alert");
<% end %>